<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>我的钱包</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body class="mui-fullscreen">
		<div id="app" class="mui-views">
			<div class="mui-view">
				<div class="mui-navbar fs_xl">
				</div>
				<div class="mui-pages fs_xl">
				</div>
			</div>
		</div>
		<include file="public/bottom_nav" />
		<if $user.is_lock == 1>
		<div class="dongjie">
			<div class="dongjie_img">
				<img style="width: 40%;margin-left: 8em;margin-top: 4em;" src="__STATIC__/images/dongjie.png" />
				<p class="fs_xl">冻结时间：{$user.lock_time|date="Y-m-d H:i:s",###}</p>
			</div>
			<div class="dongjie_info">
				<p class="fs_m">经系统核实，您的账号出现异常操作，为了平台和您的账户安全，平台已经将您的账户进行冻结！如有疑问，请联系平台客服人员，联系方式13086606928;微信号：526895676;QQ：526895676</p>
			</div>
		</div>
		</if>
		<div id="setting" class="mui-page">
			<!--页面标题栏开始-->
			<div class="mui-navbar-inner mui-bar mui-bar-nav">
				<if !empty($baseurl)>
					<a class="mui-left mui-btn mui-btn-link mui-btn-nav mui-pull-left fs_xl" href="{$baseurl}">
						<span class="mui-icon mui-icon-left-nav fs_xxi"></span>
					</a>
				<else>
					<button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left fs_xl">
						<span class="mui-icon mui-icon-left-nav fs_xxi"></span>
					</button>
				</else>		
				</if>
				<h1 class="mui-center mui-title black_m fs_xl">我的钱包</h1>
			</div>
			<!--页面标题栏结束-->
			<!--页面主内容区开始-->
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						<ul class="mui-table-view mui-table-view-chevron">
							<li class="mui-table-view-cell fs_xl cls">
								<a href="#yue" class="mui-navigate-right nicheng"><i class="mui-icon iconfont icon-qian-copy fs_xxi"></i>余额<span>¥{$user.user_money}</span></a>
							</li>
							<li class="mui-table-view-cell">
								<a href="{:U('Mobile/User/gold')}" class="mui-navigate-right gold"><i class="mui-icon iconfont icon-qian-copy fs_xxi"></i>金酒币<span>{$user.pay_gold}币</span></a>
							</li>
							<li class="mui-table-view-cell">
								<a href="silver.html" class="mui-navigate-right mob"><i class="mui-icon iconfont icon-qian-copy fs_xxi"></i>银酒币<span>{$user.pay_points}币</span></a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<!--页面主内容区结束-->
		</div>
		<div id="yue" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav fs_xl">
				<button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left fs_xl">
					<span class="mui-icon mui-icon-left-nav fs_xxi"></span>
				</button>
				<h1 class="mui-center mui-title black_m fs_xl">我的余额</h1>
			</div>
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						<div class="my_ye">
							<p class="fs_m">金额（元）</p>
							<p class="fs_xs"><span>¥<em class="fs_xxi">{$user.user_money}</em></span></p>
						</div>
						<ul class="mui-table-view mui-table-view-chevron">
							<li class="mui-table-view-cell">
								<a href="{:U('Mobile/User/recharge')}" class="mui-navigate-right"><i class="mui-icon iconfont icon-chongzhi fs_xxi" style="padding-right: 0.2em;color: #f58b01;"></i>充值</a>
							</li>
							<li class="mui-table-view-cell">
								<a href="#tixian" class="mui-navigate-right"><i class="mui-icon iconfont icon-qianbao fs_xxi" style="padding-right: 0.2em;color: #f58b01;"></i>提现</a>
							</li>
						</ul>
						<ul class="mui-table-view mui-table-view-chevron">
							<li class="mui-table-view-cell">
								<a href="{:U('Mobile/User/money_detail')}" class="mui-navigate-right"><i class="mui-icon iconfont icon-wuyuemingxi fs_xxi" style="padding-right: 0.2em;color: #4d90e7;"></i>明细</a>
							</li>
						</ul>
						<div class="fs_m" style="padding: 0.5em;margin-top: 1em;">
							<p class="fs_l">温馨提示：</p>
							<p class="fs_xs">1、余额在提现时，需要准确填写提现人的微信账户或者银行账户。</p>
							<p class="fs_xs">2、平台试运营期间暂不支持自动到账功能，用户申请提现将暂停手动转账，详情请查看平台公告。</p>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="chongzhi" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav fs_l">
				<button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left fs_xl">
					<span class="mui-icon mui-icon-left-nav fs_xxi"></span>
				</button>
				<h1 class="mui-center mui-title black_m fs_xl">充值</h1>
			</div>
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						
					</div>
				</div>
			</div>
		</div>
		<div id="tixian" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav fs_l">
				<button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left fs_xl">
					<span class="mui-icon mui-icon-left-nav fs_xxi"></span>
				</button>
				<h1 class="mui-center mui-title black_m fs_xl">提现</h1>
			</div>
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						<div class="tixian_top fs_l">
							<ul>
								<li class="active">微信</li>
								<li>银行卡</li>
							</ul>
						</div>
						<div class="tixian_box">
							<div class="tixian_m" style="display: block;">
								<form id="wxtx">
								<input type="hidden" name="bank_name" value="微信">
								<a>
									<label>金额</label>
									<input class="ffff" type="text" placeholder="您当前可用金额￥{$user.user_money}" name="money" id="" onkeyup="(this.v=function(){this.value=this.value.replace(/[^\d.]/g,'');}).call(this);if(this.value>{$user.user_money}){this.value={$user.user_money};}" onblur="this.v();" />
								</a>
								<a>
									<label>账号</label>
									<input type="text" placeholder="到账微信账号" name="account_bank" id="" />
								</a>
								<a>
									<label>姓名</label>
									<input type="text" placeholder="收款人姓名" name="account_name" id="" />
								</a>
								<div class="tixian_btn" data-id="wxtx"><a>确认提现</a></div>
								</form>
							</div>
							<div class="tixian_m">
								<form id="yhtx">
								<a>
									<label>卡&nbsp;&nbsp;&nbsp;号</label>
									<input type="text" placeholder="卡号" name="account_bank" id="" size="25" onblur="CheckBankNo(this)" />
								</a>
								<a>
									<label>开户行</label>
									<input type="text" placeholder="开户银行" name="bank_name" id="" />
								</a>
								<a>
									<label>持卡人</label>
									<input type="text" placeholder="姓名" name="account_name" id="" />
								</a>
								<a>
									<label>金&nbsp;&nbsp;&nbsp;额</label>
									<input class="ffff" type="text" placeholder="您当前可用金额￥{$user.user_money}" name="money" id="" onkeyup="(this.v=function(){this.value=this.value.replace(/[^\d.]/g,'');}).call(this);if(this.value>{$user.user_money}){this.value={$user.user_money};}" onblur="this.v();" />
								</a>
								<div class="tixian_btn" data-id="yhtx"><a>确认提现</a></div>
								</form>
							</div>
						</div>
						<a style="width:100%;text-align: center;padding-top: 1em;" class="fs_m mui-icon mui-icon-help fs_xxl" href="{:U('Mobile/User/withdrawals_detail')}"><span style="padding-left: 0.6em;" class="fs_m">提现记录</span></a>
					</div>
				</div>
			</div>
		</div>
		<div id="mingxi" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav fs_l hx_1">
				<button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left fs_xl">
					<span class="mui-icon mui-icon-left-nav fs_xxi"></span>
				</button>
				<h1 class="mui-center mui-title black_m fs_xl">余额明细</h1>
			</div>
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						<div class="ye_mx fs_m">
							<ul>
								<li class="cls">
									<a class="fs_m">分销收益</a>
									<a class="fs_m"><em class="fs_xs">2017-08-22</em></a>
									<a class="fs_m"><em class="fs_xs">余额：¥492.00</em></a>
									<a class="fs_m"><em>+</em>88.00</a>
								</li>
								<li class="cls">
									<a class="fs_m">分销收益</a>
									<a class="fs_m"><em class="fs_xs">2017-08-22</em></a>
									<a class="fs_m"><em class="fs_xs">余额：¥492.00</em></a>
									<a class="fs_m"><em>+</em>88.00</a>
								</li>
								<li class="cls">
									<a class="fs_m">分销收益</a>
									<a class="fs_m"><em class="fs_xs">2017-08-22</em></a>
									<a class="fs_m"><em class="fs_xs">余额：¥492.00</em></a>
									<a class="fs_m"><em>+</em>88.00</a>
								</li>
								<li class="cls">
									<a class="fs_m">分销收益</a>
									<a class="fs_m"><em class="fs_xs">2017-08-22</em></a>
									<a class="fs_m"><em class="fs_xs">余额：¥492.00</em></a>
									<a class="fs_m"><em>+</em>88.00</a>
								</li>
								<li class="cls">
									<a class="fs_m">分销收益</a>
									<a class="fs_m"><em class="fs_xs">2017-08-22</em></a>
									<a class="fs_m"><em class="fs_xs">余额：¥492.00</em></a>
									<a class="fs_m"><em>+</em>88.00</a>
								</li>
								<li class="cls">
									<a class="fs_m">分销收益</a>
									<a class="fs_m"><em class="fs_xs">2017-08-22</em></a>
									<a class="fs_m"><em class="fs_xs">余额：¥492.00</em></a>
									<a class="fs_m"><em>+</em>88.00</a>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			mui.init();
			//初始化单页view
			var viewApi = mui('#app').view({
				defaultPage: '#setting'
			});
			//初始化单页的区域滚动
			mui('.mui-scroll-wrapper').scroll();
			var view = viewApi.view;
			(function($) {
				//处理view的后退与webview后退
				var oldBack = $.back;
				$.back = function() {
					if(viewApi.canBack()) { //如果view可以后退，则执行view的后退
						viewApi.back();
					} else { //执行webview后退
						oldBack();
					}
				};
				//监听页面切换事件方案1,通过view元素监听所有页面切换事件，目前提供pageBeforeShow|pageShow|pageBeforeBack|pageBack四种事件(before事件为动画开始前触发)
				//第一个参数为事件名称，第二个参数为事件回调，其中e.detail.page为当前页面的html对象
				view.addEventListener('pageBeforeShow', function(e) {
					//				console.log(e.detail.page.id + ' beforeShow');
				});
				view.addEventListener('pageShow', function(e) {
					//				console.log(e.detail.page.id + ' show');
				});
				view.addEventListener('pageBeforeBack', function(e) {
					//				console.log(e.detail.page.id + ' beforeBack');
				});
				view.addEventListener('pageBack', function(e) {
					//				console.log(e.detail.page.id + ' back');
				});
			})(mui);
			$(function(){
				$(".tixian_top li").click(function() {
					$(".tixian_top li").removeClass("active").eq($(".tixian_top li").index(this)).addClass("active");
					$(".tixian_m").hide().eq($('.tixian_top li').index(this)).show();
				});
			})

			$(function(){
				$(".tixian_btn").on("tap",function(){
					var arr=[];
					s3=$(this).siblings("a").find("input");
					s4=$(this).siblings("a").find(".ffff").val();
					d3=$(this).attr("data-id");
					for(var i=0;i<s3.length;i++){
						arr.push(s3.eq(i).val());
					}
					if(arr[0].length==0||arr[1].length==0||arr[2].length==0){
						alert("请完整填写正确的提现信息！")
					}else{
						if(s4.length==0){
							alert("请输入正确的提现金额哦！不能为空！");
							return false;
						}else if(s4==0){
							alert("提现金额不能为0哦！");
							return false;
						}else{
							$.post("{:U('Mobile/User/withdrawals')}",$('#'+d3).serializeArray(),function(data){
                				if(data.code==-1){
                					alert(data.msg);
                				}else{
                					alert("你的申请已提交，平台将在24小时内完成提现，请耐心等待！");
                				    $(".tixian_m").find("input").val("");
                				}
                			},'json');
						}
						
					}
				})
			})
		</script>
		<!--<script language="javascript" type="text/javascript">
			function formatBankNo (BankNo){
    			if (BankNo.value == "") return;
    			var account = new String (BankNo.value);
    			account = account.substring(0,23); /*帐号的总数, 包括空格在内 */
    			if (account.match (".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}") == null){
        			/* 对照格式 */
        			if (account.match (".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}|" + ".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}|" + ".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}|" + ".[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{7}") == null){
            			var accountNumeric = accountChar = "", i;
            			for (i=0;i<account.length;i++){
                			accountChar = account.substr (i,1);
                			if (!isNaN (accountChar) && (accountChar != " ")) accountNumeric = accountNumeric + accountChar;
            			}
            			account = "";
            			for (i=0;i<accountNumeric.length;i++){    /* 可将以下空格改为-,效果也不错 */
                			if (i == 4) account = account + " "; /* 帐号第四位数后加空格 */
                			if (i == 8) account = account + " "; /* 帐号第八位数后加空格 */
                			if (i == 12) account = account + " ";/* 帐号第十二位后数后加空格 */
                			if (i == 16) account = account + " ";/* 帐号第十六位后数后加空格 */
                			account = account + accountNumeric.substr (i,1)
           				 }
        			}
    			}else{
        			account = " " + account.substring (1,5) + " " + account.substring (6,10) + " " + account.substring (14,18) + "-" + account.substring(18,25);
    			}
    			if (account != BankNo.value) BankNo.value = account;
			}
		</script>-->
		<script type="text/javascript">
　　			function CheckBankNo(t_bankno) {
  　　				var bankno = $.trim($(t_bankno).val());
  　　				if(bankno == "") {
    　　					alert("请填写银行卡号");
     				return false;
   				}
   				if(bankno.length < 15 || bankno.length > 20) {
     				alert("银行卡号长度必须在16到19之间");
     				return false;
   				}
   				var num = /^\d*$/; //全数字
   				if(!num.exec(bankno)) {
     				alert("银行卡号必须全为数字");
     				return false;
   				}//开头6位
   				var strBin = "10,18,30,35,37,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,62,65,68,69,84,87,88,94,95,98,99";
   				if(strBin.indexOf(bankno.substring(0, 2)) == -1) {
     				alert("银行卡号开头6位不符合规范");
     				return false;
   				}
   			}
		</script>

	</body>

</html>